#include<bits/stdc++.h>
#include<unordered_set>
using namespace std;

string s1 = "tocyjkdzcieoiodfpbgcncsrjbhmugdnojjddhllnofawllbhfiadgdcdjstemphmnjihecoapdjjrprrqnhgccevdarufmliqijgihhfgdcmxvicfauachlifhafpdccfseflcdgjncadfclvfmadvrnaaahahndsikzssoywakgnfjjaihtniptwoulxbaeqkqhfwl";
string s = "lanqiao";
unordered_set<string> S;
int n;
void dfs(int i, string cur) {
    // 遍历到最后返回
    if (s[i] == '\0') return;
    // 如果当前索引的字符 大于 cur串最后的字符 
    if (cur.empty() || s[i] > cur.back()) {
        if (!S.count(cur + s[i])) {
            S.insert(cur + s[i]);
            dfs(i + 1, cur + s[i]);
        }
    }
    dfs(i + 1, cur);
}

int main() {
    n = s.length();
    dfs(0, "");
    cout << S.size() << endl;
    return 0;
}